package org.openzip.jarsfx.unpacking.controller;

import javax.swing.JOptionPane;

import org.openzip.jarsfx.unpacking.model.IOpenZipUnpacker;
import org.openzip.jarsfx.unpacking.model.OpenZipUnpacker;
import org.openzip.jarsfx.unpacking.view.IUnpackerUI;
import org.openzip.jarsfx.unpacking.view.JarFileAdapter;
import org.openzip.jarsfx.unpacking.view.swing.UnpackerGUI;

public class UnpackerController
{
	public static void main(String[] args){
		
		IOpenZipUnpacker unpacker = new OpenZipUnpacker();
		IUnpackerUI gui = null;
		try{
			gui = new UnpackerGUI(/*new JarFileAdapter()*/);
		}
		catch(Exception e){
			JOptionPane.showMessageDialog(null, "Specified archive cannot be " +
					"loaded. File may be damaged.", "Error", 
					JOptionPane.ERROR_MESSAGE);
			e.printStackTrace();
			return;
		}
		gui.showGui(unpacker);
		
	}
}
